package com.github.livebase.bean;

import com.github.livebase.util.base.DateUtil;

import java.util.Date;

/**
 * @ClassName EpgInformation
 * @description:
 * @author: biao532
 * @create: 2023-12-18 14:26
 * @Version 1.0
 **/

public class EpgInformation {
    public static final EpgInformation NO_INFORMATION = new EpgInformation("NO_INFORMATION",
            946656000000l, 946742399000l,
            "暂无相关信息");
    private String channelId;
    private long start;
    private long end;
    private String title;
    public EpgInformation(String channelId, long start, long end, String title) {
        this.channelId = channelId;
        this.title = title;
        this.start = start;
        this.end = end;
    }
    public EpgInformation(String channelId, long start, long end) {
        this(channelId, start, end, null);
    }
    protected EpgInformation() {
    }
    public void setTitle(String title) {
        this.title = title;
    }

    public void setTimeSegment(long start, long end) {
        this.start = start;
        this.end = end;
    }

    public long getEnd() {
        return end;
    }

    public long getStart() {
        return start;
    }

    public String getStartString() {
        return DateUtil.format(DateUtil.HH_mm, new Date(this.start));
    }
    public long getDuration() {
        return end - start;
    }
    public String getEndString() {
        return DateUtil.format(DateUtil.HH_mm, new Date(this.end));
    }

    public String getTitle() {
        return title;
    }

    public String getChannelId() {
        return channelId;
    }
}
